<html>
<body>

<script type="text/javascript">
    // 获取网址前缀
    document.write(location.protocol);
    //获取路径名
    document.write(location.pathname);
</script>
</body>
</html>